# 通过传入list, tuple, set等参数(很多iterable都可以)
def add(nums):
    sum = 0
    for num in nums:
        sum += num
    return sum


print(add([1, 2, 3, 4, 5]))
print(add((1, 2, 3, 4, 7)))
print(add({1, 2, 3, 4, 5, 6, 7, 8}))
print(add(range(1, 101)))
